package com.chenyun.message;

import com.chenyun.message.tio.TioWebsocketStarter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;

/**
 * BeanConfiguration：
 * Description:
 *
 * @author: Lonni
 * @date: 2024/5/7 0007 16:32
 */
@Configuration
@ConditionalOnProperty(value = "chenyun.message.enableWs",havingValue = "true")
public class BeanConfiguration implements Serializable {

    @Bean(initMethod = "start")
    public TioWebsocketStarter tioWebsocketStarter(@Autowired MessageProperties properties){
        return new TioWebsocketStarter(properties);
    }

}



